package com.ibuonline.b2b.entity;

import java.io.Serializable;

public class VerifyCode implements Serializable {

	private static final long serialVersionUID = -7354766143560575251L;

	//fields
	private java.lang.Integer memberId;
	private java.lang.String verifyType;
	private java.lang.String verifyCode;
	private java.sql.Timestamp expireDate;

	//default constructor
	public VerifyCode() {
	}

	//constructor with arguments
	public VerifyCode(java.lang.Integer memberId, java.lang.String verifyType) {
		this.memberId = memberId;
		this.verifyType = verifyType;
	}

	//getter
	public java.lang.Integer getMemberId() {
		return memberId;
	}
	public java.lang.String getVerifyType() {
		return verifyType;
	}
	public java.lang.String getVerifyCode() {
		return verifyCode;
	}
	public java.sql.Timestamp getExpireDate() {
		return expireDate;
	}

	//setter
	public void setMemberId(java.lang.Integer memberId) {
		this.memberId = memberId;
	}
	public void setVerifyType(java.lang.String verifyType) {
		this.verifyType = verifyType;
	}
	public void setVerifyCode(java.lang.String verifyCode) {
		this.verifyCode = verifyCode;
	}
	public void setExpireDate(java.sql.Timestamp expireDate) {
		this.expireDate = expireDate;
	}

	//equals method
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof VerifyCode))
			return false;

		final VerifyCode verifyCode = (VerifyCode)other;
		if (!this.memberId.equals(verifyCode.getMemberId()) || 
			!this.verifyType.equals(verifyCode.getVerifyType()))
			return false;

		return true;
	}

	//hashCode method
	public int hashCode() {
		StringBuffer keys = new StringBuffer();
		keys.append(memberId).append(",");
		keys.append(verifyType).append(",");
		if (keys.length() > 0)
			keys.deleteCharAt(keys.length() - 1);
		return keys.toString().hashCode();
	}

	//toString method
	public String toString() {
		return new StringBuilder("VerifyCode[")
			.append("memberId=").append(memberId).append(", ")
			.append("verifyType=").append(verifyType).append(", ")
			.append("verifyCode=").append(verifyCode).append(", ")
			.append("expireDate=").append(expireDate).append("]").toString();
	}
}